home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / SAT 2.3.8 / Demos / SATminimal demo ƒ / SATminimal.p < prev    next >
Text File  |  1996-05-23  |  1KB  |  43 lines

  1. {Minimal demo program, with a few sprites moving back and forth.}
  2.  
  3. program SATminimal;
  4.  
  5.     uses
  6. {$ifc UNDEFINED THINK_PASCAL}
  7.         Types, QuickDraw, Menus, Windows, TextEdit, Fonts,
  8.         Dialogs, Memory, Events, {}
  9. {$endc}
  10.         SAT, sMySprite;
  11.     var
  12.         ignoreSp: SpritePtr;
  13.         l: longint;
  14. begin
  15. {Standard Inits are done by Think Pascal.}
  16. {$ifc UNDEFINED THINK_PASCAL}
  17.     SATInitToolbox;
  18. {$endc}
  19.  
  20. {Initialize, using PICTs 128 or 129 as background, Classic-sized drawing area}
  21.     SATInit(128, 129, 512, 322);
  22.  
  23. {Initialize sprite unit(s), by preloading faces and sounds}
  24.     InitMySprite;
  25.  
  26. {Make some sprites}
  27.     ignoreSp := SATNewSprite(0, 50, 50, @SetupMySprite);
  28.     ignoreSp := SATNewSprite(0, 100, 100, @SetupMySprite);
  29.     ignoreSp := SATNewSprite(0, 125, 120, @SetupMySprite);
  30.     ignoreSp := SATNewSprite(0, 150, 140, @SetupMySprite);
  31.     ignoreSp := SATNewSprite(0, 200, 180, @SetupMySprite);
  32.     ignoreSp := SATNewSprite(0, 250, 200, @SetupMySprite);
  33.     ignoreSp := SATNewSprite(0, 300, 250, @SetupMySprite);
  34.  
  35.     repeat
  36.         l := TickCount;
  37.         SATRun(true); {Run one frame of animation}
  38.         while l > TickCount - 3 do {Maximize speed to 20 fps}
  39.             ;
  40.     until Button;
  41.  
  42.     SATSoundShutUp; {Always de-allocate the sound channel before quitting!}
  43. end.